package com.wl.service;

import com.wl.enums.CommentType;
import com.wl.model.Comment;
import com.wl.utils.PageUtil;
import com.wl.model.User;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.stereotype.Service;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by wu on 2018/4/16.
 */
public interface CommentService {
    /**
     * 评论列表
     */
    Pair<Integer, List<Comment>> commentList(Integer page, Integer pageSize, Long userId, String content);

    @Transactional
    Comment add(String content, CommentType type, Long pid, Long userId);

    @Transactional
    void del(Long commentId);

    List<Comment> getLimitComment(PageUtil pageUtil);

    Integer getCountComment();

    void updateComment (Comment comment);

    void addComment (Comment comment);

    Comment getComment(long commentId);

    void deleteComment(long commentId);

    List<Comment> findByComment(Comment comment);

    //根据父级id查询评论
    List<Comment> findByPid(Long pid);

}
